'''
Author: admin@attacker.club
Date: 2022-09-01 21:22:28
LastEditTime: 2022-09-01 22:03:17
Description: 
python xx.py id secret clusterId
'''
import sys
import json
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.request import CommonRequest


request = CommonRequest()
request.set_domain('cs.aliyuncs.com')
request.set_version('2015-12-15')
# request.set_uri_pattern('/clusters')


if __name__ == "__main__":
    id =  sys.argv[1]
    secret = sys.argv[2]
    request.set_uri_pattern('/clusters')
    client = AcsClient(id , secret , region_id='cn-shanghai')
    response = client.do_action_with_exception(request)
    # clusters = response.decode("UTF-8")
    # print(clusters,type(clusters))
    jsonObj = json.loads(response.decode("UTF-8"))
    # print(type(jsonObj))
    # print(jsonObj,type(jsonObj))
    for k in jsonObj[0]:
        if k == "name":
            print("name:",jsonObj[0][k])

        # print(clusters[row]["name"])
        # print(clusters[row]["cluster_id"])
        # print(row.region_id)
        # print(row.current_version)
        # print(row.created)
        # print(">>>>>>>>>>")
       




